__author__ = 'czyigy'
# import logging
# import os
# import logging.config
# import datetime
#
# # logger.basicConfig(filename = os.path.join(os.getcwd(), 'logs/srserver.log'),level = logger.INFO, filemode = 'a', format = '%(asctime)s - %(levelname)s: %(message)s')
#
# logging.config.fileConfig("logger.conf")
# logger = logging.getLogger("root")
#
# def init_logging():
#     file_path = './logs/{today_date}'.format(today_date = str(datetime.date.today))
#     if not os.path.exists(file_path):
#         os.mkdir(file_path)

import logging
import logging.handlers
logger = logging.getLogger()

#logger.setLevel(logging.ERROR)
logger.setLevel(logging.DEBUG)
rh=logging.handlers.TimedRotatingFileHandler('./logs/loggertester','H',12,24)
rh.suffix = "%Y%m%d%H.log"
fm=logging.Formatter("%(asctime)s %(filename)s %(funcName)s [line:%(lineno)d] %(levelname)s - %(message)s","%Y-%m-%d %H:%M:%S")
rh.setFormatter(fm)
logger.addHandler(rh)
